<template>
	<view>
		<view class="content" v-for="c in consultation">
<!-- 			<uni-card :title=" c.user.nickName " extra="额外信息"
				thumbnail="/static/2.jpg" @click="tz(c.cid)"> -->
			<uni-card :title=" c.user.nickName " extra="额外信息"
				:thumbnail="c.user.avatar" @click="tz(c.cid)">
				<text>咨询人数{{c.number}}+&nbsp;&nbsp;&nbsp;&nbsp;从业{{c.year}}年</text><br/>
				<text>{{c.introduce}}</text><br/>
				<text>擅长领域：{{c.territory}}</text>
			</uni-card>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				consultation: {},
			}
		},
		created(){
			this.queryAll();
		},
		methods: {
			queryAll(){
				uni.request({
					url: 'http://127.0.0.1:800/mhs/consultation/queryAll', //仅为示例，并非真实接口地址。
					header: {
					  'token': uni.getStorageSync('token')
					},
					success: (res) => {
						this.consultation = res.data.data;
						console.log(this.consultation)
					},
				});
			},
			tz(id) {
				uni.navigateTo({
					// '/pages/bookDetail/bookDetail?id='
					// console.log(detail),
					url: "/pages/consultationDetail/consultationDetail?id="+id,
				})
			}
		}
	}
</script>

<style>

</style>